package com.ojoin.ojoin.eb_spider.domain;

import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class AlipayRelations {
	/**
	 * 需绑定银行卡
	 */
	private BankCardCheck alipayBankCardMain;
	/**
	 * 主账号
	 */
	private AlipayAccount alipayAccountMain;
	
	/**
	 * 正在登陆验证账号
	 */
	private AlipayAccount alipayAccountLogin;
	

	/**
	 * 关联银行账号，支付宝绑定的银行账号
	 */
	private List<BankCardCheck> bankCards;

	/**
	 * 关联账号包含本账号，自己与自己关联，方便账号之间比较
	 */

	private List<AlipayAccount> relations;

	/**
	 * 是否需要绑定
	 */
	private boolean isNeedUnpinless = true ;
	
	/**
	 * 时间
	 */
	private Date  checkedStartTime ;
	
	
	
	

	public List<BankCardCheck> getBankCards() {
		return bankCards;
	}

	public void setBankCards(List<BankCardCheck> bankCards) {
		this.bankCards = bankCards;
	}

	public List<AlipayAccount> getRelations() {
		return relations;
	}

	public void setRelations(List<AlipayAccount> relations) {
		this.relations = relations;
	}

	

	public BankCardCheck getAlipayBankCardMain() {
		return alipayBankCardMain;
	}

	public void setAlipayBankCardMain(BankCardCheck alipayBankCardMain) {
		this.alipayBankCardMain = alipayBankCardMain;
	}

	public AlipayAccount getAlipayAccountMain() {
		return alipayAccountMain;
	}

	public void setAlipayAccountMain(AlipayAccount alipayAccountMain) {
		this.alipayAccountMain = alipayAccountMain;
	}

	public boolean isNeedUnpinless() {
		return isNeedUnpinless;
	}

	public void setNeedUnpinless(boolean isNeedUnpinless) {
		this.isNeedUnpinless = isNeedUnpinless;
	}

	public Date getCheckedStartTime() {
		return checkedStartTime;
	}

	public void setCheckedStartTime(Date checkedStartTime) {
		this.checkedStartTime = checkedStartTime;
	}

	public AlipayAccount getAlipayAccountLogin() {
		return alipayAccountLogin;
	}

	public void setAlipayAccountLogin(AlipayAccount alipayAccountLogin) {
		this.alipayAccountLogin = alipayAccountLogin;
	}

	public boolean checkRelations(List<String> list){
		if(relations.size() == list.size()){
			 Iterator<AlipayAccount> it = relations.iterator();
			 
			 while(it.hasNext()){
				 AlipayAccount aa = it.next();
				 if(!list.contains(aa.getUsername())){
					 return false;
				 }
			 }
			 return true ;
		}else {
			return false ;
		}

	}

	
	
	
	
}
